<?php

namespace Admin\Models;

use Illuminate\Database\Eloquent\Model;

class UserModel extends Model
{
    protected $table = 'admin_users';
    
    public function find($id=0){
        if($id>0){
         return DB::table($this->table)->where('id',$id);
        }
        else{
            return false;
        }
    }
        public function setPassword($username='',$password=""){
        if($username!="" && $password!=""){
            $aP = array();
            $aP['password'] = bcrypt($password);
            return DB::table($this->table)->where('username',$username)->save($aP);
        }else{
            return false;
        }
    }
        
}
